package com.yanqu.road.server.cmd.activity.fivehero;

import com.yanqu.road.entity.activity.fivehero.FiveHeroConfig;
import com.yanqu.road.entity.activity.seasontask.SeasonTaskConditionData;
import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.FiveHeroProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.fivehero.FiveHeroModule;
import com.yanqu.road.server.manger.activity.ActivityMgr;
import com.yanqu.road.server.manger.activity.fivehero.FiveHeroMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.manger.union.GameUnionActivityGroupMgr;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.GameProtocol;

import java.math.BigInteger;

@Cmd(code = GameProtocol.S_FIVEHERO_COST_STAMINE, desc = "")
public class CrossFiveHeroNotifyCostCmd extends AbstractCommand {

    private FiveHeroProto.CrossFiveHeroCostMsg reqMsg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        reqMsg = FiveHeroProto.CrossFiveHeroCostMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        SeasonTaskConditionData data = new SeasonTaskConditionData(BigInteger.valueOf((long) FiveHeroMgr.getActivityInfo().getType()), BigInteger.valueOf((long)reqMsg.getCostCount()));
        player.notifyListener(eGamePlayerEventType.FiveHeroCostStaminaTask.getValue(), data);
    }

    @Override
    public void sendData(GamePlayer player) {
        if (ret == 0) {
            return;
        }
    }
}
